<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>美滴滴</title>
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0, maximum-scale=1.0">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link type="text/css" rel="stylesheet" media="screen" href="__PUBLIC__/app/css/style.css{$JSDEBUG}"/>
    <link type="text/css" rel="stylesheet" media="screen" href="__PUBLIC__/app/css/media.css{$JSDEBUG}"/>
    <script type="text/javascript" src="__PUBLIC__/app/js/jquery-1.9.1.min.js"></script>
    <style>
		body{padding-top: 0px;}
	</style>
</head>
<body style="background:#fff;">
	<include file="Public/customHeader" title="重置密码" url="{:U('Beautician/login')}"/>
    <form action="{:U('Beautician/repeat')}" method="post">
	 	<section>
	      <div class="login mrslogin">
	        <h1><img src="__PUBLIC__/app/images/loginlogo.png"></h1>
	        <ul>
	          <li><input type="text" name="mobile" placeholder="请输入手机号码" class="phone" ></li>
	          <li><input type="password" name="password" placeholder="请输入新密码" class="code">          </li>
	           <li><a href="javascript:;" class="dllogin">重置密码</a></li>
	          <!-- <li><a href="yanzheng.html" class="dllogin" >重置密码</a></li>  填写完addClass("addbg")-->
	        </ul>
	      </div> 
		</section>
	</form>
<script>
$(function () {
	var submitUserInfo;
	$(".dllogin").click(function () {
		if (submitUserInfo && submitUserInfo.state() == 'pending') {
			return false;
		}
		
		var phone = $('input[name="mobile"]').val();
		var reg=/^\d{11}$/;
		if (!reg.test(phone)) {
			alert('输入的手机号码不正确');
			return false;
		}
		
		var password = $('input[name="password"]').val();
		if (password.length < 6 || password.length>16) {
			alert('输入6-16位密码');
			return false;
		}
		
		var form = $('form').get(0);
		submitUserInfo = $.ajax({
			url: form.action,
			data: $(form).serialize(),
			type: 'post',
			dataType: 'json',
			success: function (result) {
				if (result.status == '1') {
					window.location.href = result.redirect;
				} else {
					alert(result.message);
					return false;
				}
			},
			error: function () {
				alert('设置密码失败');
			}
		});
		
		return false;
	});
});
</script>
</body>
</html>